<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" class="heroName">
<button>查询</button>
<h1></h1>
<h2></h2>
<script src="lib/jquery.3.6.0.js"></script>
<script>
$(function(){
    $("button").click(function(){
        const heroName=$('.heroName').val();
        $.ajax({
            url:'http://127.0.0.1:3001/getHeroSkin',
            type:'get',
            data:{heroName},
            success:function(res){
               $('h1').text(res.data.cname)
               $('h2').text(res.data.skin_name)
            }
        })
    })
})
</script>
</body>
</html>